{% load form_helpers %}

<div class="mb-10 d-lg-flex justify-content-center{% if field.errors %} has-error{% endif %}">
    <label class="col-lg-3 col-form-label{% if field.field.required %} nb-required{% endif %}" for="{{ field.id_for_label }}">
        {{ field.label }}
    </label>
    <div class="col-lg-3 pe-lg-10">
        <div class="form-check my-6{% if override_field.errors %} has-error{% endif %}">
            {{ override_field }}
            <label class="form-check-label" for="{{ override_field.id_for_label }}">
                <i>Override default value</i>
                {% if override_field.help_text %}
                    <span class="form-text">{{ override_field.help_text|safe }}</span>
                {% endif %}
            </label>
        </div>
    </div>
    <div class="col-lg-6">
        {% if field|widget_type == 'checkboxinput' %}
            <div class="form-check my-6{% if field.errors %} has-error{% endif %}">
                {{ field }}
                <label class="form-check-label" for="{{ field.id_for_label }}">
                    {{ field.label }}
                    {% if field.help_text %}<span class="form-text">{{ field.help_text|safe }}</span>{% endif %}
                </label>
            </div>
        {% else %}
            {{ field }}
            {% if field.help_text %}<span class="form-text">{{ field.help_text|safe }}</span>{% endif %}
        {% endif %}
        {% if field.errors %}
            <ul>
                {% for error in field.errors %}
                    {# Embed an HTML comment indicating the error for extraction by tests #}
                    <!-- FORM-ERROR {{ field.name }}: {{ error }} -->
                    <li class="text-danger">{{ error }}</li>
                {% endfor %}
            </ul>
        {% endif %}
    </div>
</div>
